<!--
 * @Author: Steven 156467723@qq.com
 * @Date: 2022-05-22 12:38:11
 * @LastEditors: Steven 156467723@qq.com
 * @LastEditTime: 2022-05-22 12:38:12
 * @FilePath: \Day_JSd:\Code_qianduan\三组仓库\codehub\魏晨辉.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>银行卡号</title>
    <style>
        input{
            display: inline-block;
            width: 300px;
            height: 30px;
            outline: none;
            padding: 5px;
        }
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
    </style>
</head>
<body>
    <div>
        <span>请输入您的银行卡号：</span>
        <input type="text" maxlength="23">
    </div>
    <script>
        const inp=document.querySelector('input');
        inp.oninput=function(){
            this.value = this.value.replace(/\D/g, "").replace(/(\d{4})(?=\d)/g, "$1 ");
        }
    </script>
</body>
</html>